<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%user_message}}".
 *
 * @property integer $id
 * @property integer $uid
 * @property integer $user_type
 * @property string $username
 * @property string $nickname
 * @property string $pic
 * @property string $email
 * @property string $realname
 * @property string $tel
 * @property string $birthday
 * @property string $provience
 * @property string $city
 * @property string $district
 * @property string $address_detail
 * @property string $identity
 * @property string $identity_front
 * @property string $identity_back
 * @property string $drive
 * @property string $drive_front
 * @property string $drive_back
 * @property string $brief
 * @property string $intro
 * @property string $show
 * @property string $reserve1
 * @property string $reserve2
 * @property string $reserve3
 */
class UserMessage extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%user_message}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['uid', 'username', 'tel'], 'required'],
            [['uid', 'user_type', 'tel'], 'integer'],
            [['birthday'], 'safe'],
            [['intro'], 'string'],
            [['username', 'nickname', 'email', 'realname', 'provience', 'city', 'district', 'identity', 'identity_front', 'identity_back', 'drive', 'drive_front', 'drive_back'], 'string', 'max' => 40],
            [['pic','pic_small', 'address_detail', 'brief', 'reserve1', 'reserve2', 'reserve3'], 'string', 'max' => 80],            [['show'], 'string', 'max' => 150],
            [['username'], 'unique'],
            [['uid'], 'unique']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'uid' => '用户ID',
            'user_type' => '用户类型',
            'username' => '用户名', //自动生成
            'nickname' => '昵称',
            'pic' => '头像',
            'pic_small' => '头像缩略图',
            'email' => '邮箱',
            'realname' => '真名',
            'tel' => '电话',
            'birthday'=>'出生日期',
            'provience' => '省份',
            'city' => '城市',
            'district' => '地区',
            'address_detail' => '详细地址',
            'identity' => '身份证号',
            'identity_front' => '身份证正面',
            'identity_back' => '身份证反面',
            'drive' => '驾驶证号',
            'drive_front' => '驾驶证正面',
            'drive_back' => '驾驶证反面',
            'brief' => '一句话简介',
            'intro' => '详细介绍',
            'show' => '个人风采',
            'reserve1' => '预留1',
            'reserve2' => '预留2',
            'reserve3' => '预留3',
        ];
    }
}
